﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;
using System.Globalization;
using System.Windows.Media;
using ReporterEngine.Model;

namespace Reporter.Converters
{
    [ValueConversion(typeof(string), typeof(TextDecoration))]
    public class StringToFontStyleConverter : IValueConverter
    {
        public string SourceValue { get; set; }
        public string MatchTextDecoration { get; set; }
        public string MisMatchTextDecoration { get; set; }

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null || (string.Compare(SourceValue, value.ToString()) == 0))
                return MatchTextDecoration;

            return MisMatchTextDecoration;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
